<script type="text/javascript" src="{$module_dir}js/jquery.rating.pack.js"></script>
<script type="text/javascript">
	$(function(){literal}{{/literal} $('input[@type=radio].star').rating(); {literal}}{/literal});
</script>
<div id="commentrate">
	<div class="title_list"><h2>{l s='Đánh giá của bạn' mod='ratecomments'}</h2></div>
	{if $cookie->isLogged()}
		{if $confirmation}<p>{$confirmation}</p>{/if}
		<form action="{$action_url}" method="post" class="std productPgList" id="sendComment">
			<div class="box-rate">
				<label style="style="padding-top: 3px;margin-right: 38px !important;"">{l s='Đánh giá' mod='ratecomments'}</label>
				<input class="star" type="radio" name="grade" value="1" />
				<input class="star" type="radio" name="grade" value="2" />
				<input class="star" type="radio" name="grade" value="3" />
				<input class="star" type="radio" name="grade" value="4" />
				<input class="star" type="radio" name="grade" value="5" />
			</div>
			<p>
				<label for="comment_title">{l s='Khách hàng:' mod='ratecomments'}</label>
				{if $cookie->isLogged()}
					<span>{$cookie->customer_firstname} {$cookie->customer_lastname}</span>
				{/if}
			</p>
			<p>
				<label for="content">{l s='Nhận xét:' mod='ratecomments'}</label>
				<textarea cols="46" rows="5" name="content" id="content"></textarea>
			</p>
			<p class="submit">
				<input class="button-rate" name="submitMessage" value="{l s='Bình luận' mod='productcomments'}" type="submit" />
				<input class="button-rate" value="{l s='Làm lại' mod='productcomments'}" type="reset" />
			</p>
		
		</form>
	{else}
		<p><a href="{$base_dir}authentication.php">{l s='Please, Login for comment' mod='ratecomments'}</a></p>
	{/if}
	
		<div class="clear productPgList" style="margin-top: 15px;">
			<div class="wrap-title-comment">
				{l s='Thể hiện'} <span class="number">1 - {count($listComment)}</span> trong tất cả các nhận xét {count($listComment)}
				<a href="#" id="mycarousel-prev">« Prev</a>
                <a href="#" id="mycarousel-next">Next »</a>
			</div>
			{if $listComment}
				<div class="wrap-comment">
					<div class="jcarousel">
						<ul id="mycarousel">
							{assign var='i' value=0}
							{foreach from=$listComment item=comment name=comment}
								{if $i%2==0}
									<li class="{$i}">
								{/if}
									{if $comment.content}
										<div class="line-comment {if $smarty.foreach.comment.iteration % 2 == 0}bg-none{/if} ">
											<div class="title-user">
												{$comment.customer_name|escape:'html':'UTF-8'}.
											</div>
											<div style="detail-comment">
												{$comment.content|escape:'html':'UTF-8'|nl2br}
											</div>
										</div>
									{/if}
									{$i=$i+1}
									{if $i%2==0}
										</li>
									{/if}	
								
							{/foreach}
							
						</ul>
						<p class="jcarousel-pagination"></p>
					</div>
				</div>
			{/if}
		</div>
	
</div>